package com.xyz.domain.ext;

public enum EnumCommonStatus {

    Valid("有效",1),InValid("无效",0);

    private String name;

    private Integer key;

    EnumCommonStatus(String name, Integer key){
        this.name = name;
        this.key = key;
    }

    public EnumCommonStatus getByKey(Integer key){
        for(EnumCommonStatus source : EnumCommonStatus.values()){
            if(source.getKey() == key){
                return source;
            }
        }
        return  null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getKey() {
        return key;
    }

    public void setKey(Integer key) {
        this.key = key;
    }

}
